package com.omenkk.juc.c1;

import com.omenkk.juc.util.Slepper;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class demo5 {
    public static void main(String[] args) {
        Thread t1=new Thread(()->{
            log.debug("洗水壶");
            Slepper.sleep(1);
            log.debug("烧开水");
          Slepper.sleep(7);
        });
        Thread t2=new Thread(()->{
            log.debug("洗茶壶");
            Slepper.sleep(1);
            log.debug("洗茶杯");
            Slepper.sleep(1);
            log.debug("拿茶叶");
            Slepper.sleep(2);
            try {
                t1.join();
                log.debug("开始泡茶");
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });
t1.start();
t2.start();
    }
}
